﻿using CutShuFa.AutoAction;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace CutShuFa
{
    public class CutSetting
    {
        private const string cutSettingFilePath = "CutSetting.json";
        public string TextFilePath { get; set;}
        public string SaveImageFolder { get; set; }

        public static CutSetting LoadCutSetting()
        {
            if (File.Exists(cutSettingFilePath))
            {
                string json = File.ReadAllText(cutSettingFilePath);
                return JsonSerializer.Deserialize<CutSetting>(json);
            }
            else
            {
                return null;
            }
        }

        public void SaveCutSetting()
        {
            string json = JsonSerializer.Serialize(this);
            File.WriteAllText(cutSettingFilePath, json);
        }
    }
}
